package io.renren.modules.collecting.service.impl;

import io.renren.modules.collecting.dao.CollectingDeviceDao;
import io.renren.modules.collecting.entity.CollectingDeviceEntity;
import io.renren.modules.collecting.service.CollectingDeviceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;



@Service("collectingDeviceService")
public class CollectingDeviceServiceImpl extends ServiceImpl<CollectingDeviceDao, CollectingDeviceEntity> implements CollectingDeviceService {

    @Autowired
    private CollectingDeviceDao collectingDeviceDao;

    //设备列表
    @Override
    public PageUtils getList(Map<String, Object> params) {
        String name = null;
        if (null != params.get("name") && !"".equals(params.get("name"))) {
            name = String.valueOf(params.get("name"));
        }
        IPage<CollectingDeviceEntity> page = collectingDeviceDao.getList(new Query<CollectingDeviceEntity>().getPage(params), name);
        return new PageUtils(page);
    }

    @Override
    public List<CollectingDeviceEntity> getBindList(List<Integer> ids) {
        return collectingDeviceDao.getBindList(ids);
    }

}